import type { OfficePalette } from '@fluentui-react-native/theme-types';

import type { OfficeThemingModule } from './officeThemingModule';

const whiteColorsPalette: OfficePalette = {
  Bkg: '#FFFFFF',
  BkgHover: '#D2D2D2',
  BkgPressed: '#B1B1B1',
  BkgSelected: '#C6C6C6',
  BkgSubtle: '#F3F3F3',
  BkgSelectionHighlight: '#737373',
  Text: '#262626',
  TextRest: '#262626',
  TextHover: '#262626',
  TextPressed: '#262626',
  TextSelected: '#262626',
  TextDisabled: '#B1B1B1',
  TextSelectionHighlight: '#FFFFFF',
  TextSecondary: '#666666',
  TextSecondaryRest: '#666666',
  TextSecondaryHover: '#505050',
  TextSecondaryPressed: '#666666',
  TextSecondarySelected: '#666666',
  TextEmphasis: '#D83B01',
  TextEmphasisRest: '#D83B01',
  TextEmphasisHover: '#EA6115',
  TextEmphasisPressed: '#A22C01',
  TextEmphasisSelected: '#D83B01',
  StrokeSelectedHover: '#969696',
  StrokeKeyboard: '#969696',
  StrokeOverRest: '#00000000',
  StrokeOverHover: '#00000000',
  StrokeOverPressed: '#00000000',
  StrokeOverSelectedRest: '#00000000',
  StrokeOverSelectedHover: '#969696',
  StrokeOverSelectedPressed: '#00000000',
  BkgCtl: '#E6E6E6',
  BkgCtlHover: '#FFF7F0',
  BkgCtlPressed: '#FBDFD0',
  BkgCtlSelected: '#E6E6E6',
  BkgCtlDisabled: '#E6E6E6',
  TextCtl: '#262626',
  TextCtlHover: '#262626',
  TextCtlPressed: '#262626',
  TextCtlSelected: '#262626',
  TextCtlDisabled: '#B1B1B1',
  StrokeCtl: '#969696',
  StrokeCtlHover: '#FBDFD0',
  StrokeCtlPressed: '#EA6115',
  StrokeCtlSelected: '#969696',
  StrokeCtlDisabled: '#D2D2D2',
  StrokeCtlKeyboard: '#FBDFD0',
  BkgCtlEmphasis: '#D83B01',
  BkgCtlEmphasisHover: '#F29F71',
  BkgCtlEmphasisPressed: '#A22C01',
  BkgCtlEmphasisDisabled: '#E6E6E6',
  TextCtlEmphasis: '#FFFFFF',
  TextCtlEmphasisHover: '#FFFFFF',
  TextCtlEmphasisPressed: '#FFFFFF',
  TextCtlEmphasisDisabled: '#B1B1B1',
  StrokeCtlEmphasis: '#A22C01',
  StrokeCtlEmphasisHover: '#D83B01',
  StrokeCtlEmphasisPressed: '#A22C01',
  StrokeCtlEmphasisDisabled: '#D2D2D2',
  StrokeCtlEmphasisKeyboard: '#A22C01',
  BkgCtlSubtle: '#FFFFFF',
  BkgCtlSubtleHover: '#FFFFFF',
  BkgCtlSubtlePressed: '#FFFFFF',
  BkgCtlSubtleDisabled: '#F3F3F3',
  TextCtlSubtle: '#262626',
  TextCtlSubtleHover: '#262626',
  TextCtlSubtlePressed: '#262626',
  TextCtlSubtleDisabled: '#B1B1B1',
  StrokeCtlSubtle: '#C6C6C6',
  StrokeCtlSubtleHover: '#969696',
  StrokeCtlSubtlePressed: '#969696',
  StrokeCtlSubtleDisabled: '#C6C6C6',
  StrokeCtlSubtleKeyboard: '#969696',
  TextHyperlink: '#D83B01',
  TextHyperlinkHover: '#A22C01',
  TextHyperlinkPressed: '#6C1E01',
  TextActive: '#262626',
  TextActiveHover: '#EA6115',
  TextActivePressed: '#A22C01',
  TextActiveSelected: '#D83B01',
  StrokeOnlyHover: '#B1B1B1',
  StrokeOnlyPressed: '#737373',
  StrokeOnlySelected: '#969696',
  TextError: '#A50000',
  TextErrorHover: '#A50000',
  TextErrorPressed: '#A50000',
  TextErrorSelected: '#A50000',
  ThumbToggleSwitchOff: '#505050',
  ThumbToggleSwitchOffHover: '#505050',
  ThumbToggleSwitchOffPressed: '#505050',
  ThumbToggleSwitchOffDisabled: '#D2D2D2',
  ThumbToggleSwitchOn: '#FFFFFF',
  ThumbToggleSwitchOnHover: '#FFFFFF',
  ThumbToggleSwitchOnPressed: '#FFFFFF',
  ThumbToggleSwitchOnDisabled: '#FFFFFF',
  BkgToggleSwitchOff: '#FFFFFF',
  BkgToggleSwitchOffHover: '#D2D2D2',
  BkgToggleSwitchOffPressed: '#B1B1B1',
  BkgToggleSwitchOffDisabled: '#FFFFFF',
  BkgToggleSwitchOn: '#D83B01',
  BkgToggleSwitchOnHover: '#EA6115',
  BkgToggleSwitchOnPressed: '#A22C01',
  BkgToggleSwitchOnDisabled: '#D2D2D2',
  StrokeToggleSwitchOff: '#505050',
  StrokeToggleSwitchOffHover: '#505050',
  StrokeToggleSwitchOffPressed: '#505050',
  StrokeToggleSwitchOffDisabled: '#D2D2D2',
  StrokeToggleSwitchOn: '#D83B01',
  StrokeToggleSwitchOnHover: '#EA6115',
  StrokeToggleSwitchOnPressed: '#A22C01',
  StrokeToggleSwitchOnDisabled: '#D2D2D2',
  SliderPrimary: '#444444',
  SliderPrimaryHover: '#D2D2D2',
  SliderPrimaryPressed: '#262626',
  SliderPrimaryDisabled: '#969696',
  SliderSecondary: '#D2D2D2',
  SliderBuffer: '#262626',
  SliderKeyboard: '#444444',
  SliderToolTipBorder: '#C6C6C6',
  SliderToolTipLabel: '#262626',
  SliderToolTipBkg: '#FFFFFF',
  AccentDark: '#C6C6C6',
  AccentLight: '#E6E6E6',
  AccentEmphasis: '#D83B01',
  AccentOutline: '#000000',
  BkgAccentTint: '#D2E0F4',
  TextAccentTint: '#242424',
  TextEmphasis2: '#D83B01',
  BkgCtlSubtleSelected: '#F3F3F3',
  TextCtlSubtleSelected: '#262626',
  BkgCtlEmphasisFocus: '#F3F3F3',
  BkgCtlSubtleFocus: '#F3F3F3',
  BkgCtlSubtleHoverDisabled: '#F3F3F3',
  BkgCtlSubtleSelectedDisabled: '#F3F3F3',
  BkgHeader: '#E6E6E6',
  TextHeader: '#262626',
  TextTextBoxPlaceholder: '#666666',
};

export function fallbackGetPalette(pal?: string): OfficePalette {
  return pal === 'TaskPane'
    ? {
        ...whiteColorsPalette,
        Bkg: 'antiquewhite',
      }
    : whiteColorsPalette;
}

export const fallbackOfficeModule: OfficeThemingModule = {
  getPalette: fallbackGetPalette,
  getConstants() {
    return {
      ramps: {
        App: ['#F8F8F8', '#EFF6FC', '#BBDAF3', '#55A4E2', '#359EDD', '#0078d7', '#283E4A', '#030C13'],
        FluentGrays: ['#FAF9F8', '#797775', '#11100F'],
        ClassicGrays: ['#FFFFFF', '#737373', '#000000'],
        Sepias: ['#ECE6DE'],
      },
      typography: {},
      fluentTypography: {},
      rampNames: {
        App: ['FakeApp1', 'App2', 'App3', 'App4', 'App5', 'App6', 'App7', 'App8'],
        FluentGrays: ['FakeGray1', 'Gray2', 'Gray3'],
        ClassicGrays: ['FakeGray4', 'Gray5', 'Gray6'],
        Sepias: ['FakeSepia'],
      },
    };
  },
} as OfficeThemingModule;
